#include <iostream>
using namespace std;

enum error_code{sucess,error};
error_code factor(int, int&, int&);
int main()

{
 int number, squared, cubed;
 error_code result;

	cout << "enter a number(0-20)";
	cin >> number;
	
	result = factor(number, squared, cubed);
	if(result == sucess)
	{
		cout << "number : "<< number<< endl;
		cout << "square:" << squared << endl;
		cout << "cubed:"<< cubed <<endl;
	}
else
cout << "error encountered";
return 0;
}
error_code factor(int n,int &rsquared,int &rcubed)
{
	
	if (n > 20)
	return error;
	else
{
	
	rsquared = n*n;
	rcubed = n*n*n;
	return sucess;
}

}

